POV-Ray : Newsgroups : povray.off-topic : Numeric performance : Re: Numeric performance Server Time
6 Sep 2024 05:15:26 EDT (-0400)
  Re: Numeric performance  
From: Warp
Date: 15 Feb 2009 14:59:28
Message: <49987420@news.povray.org>
Orchid XP v8 <voi### [at] devnull> wrote:
> If I add up a few thousand 32-bit signed integers, it takes 20 seconds.

  What are you using? A 8086? In fact, I think even a 8086 could sum
a lot more than a few thousands of integers in 20 seconds.

  Out of curiosity, I tried a small test program in my computer which
creates an array of integers, then goes through it and calculates the
sum of all the integers. I had to use an array of 100 million integers
before I got even some measurable delay, and that was 0.7 seconds.

  I bet most of the time was caused by cache misses because of the
humongous array (taking 400 megabytes of memory) rather than the summing
process.

> If I use double-precision, and then convert each number to an integer, 
> and then add it to the total, it takes 6 minutes.

> I'm wondering whether the hardware is actually that slow, or whether 
> this is a performance bug in Haskell's number libraries.

  I think there's something else fundamentally wrong with the system you
are using than summing integers or converting between floats and ints.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.